//
//  InquireView.m
//  EggSteward
//
//  Created by 王道林 on 16/9/7.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "InquireView.h"
#import "BaseLabel.h"
#import "Masonry.h"

@interface InquireView ()
@property (nonatomic, strong) BaseLabel *lableTitle;
@property (nonatomic, strong) BaseLabel *lablePlace;
@property (nonatomic, strong) BaseLabel *lablePrice;
@end
@implementation InquireView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title place:(NSString *)place Price:(NSString *)price
{
    self = [super initWithFrame:frame];
    if (self) {
        _lableTitle = [[BaseLabel alloc] init];
        _lableTitle.textColor = [UIColor colorWithRed:0.157 green:0.651 blue:0.278 alpha:1.000];
        [[NSNotificationCenter defaultCenter] removeObserver:_lableTitle name:@"night" object:nil];
        [[NSNotificationCenter defaultCenter] removeObserver:_lableTitle name:@"day" object:nil];

        _lableTitle.text = title;
        _lableTitle.font = [UIFont systemFontOfSize:19];
        [self addSubview:_lableTitle];
        
        _lablePlace = [[BaseLabel alloc] init];
        _lablePlace.textColor = [UIColor blackColor];
        _lablePlace.text = place;
        [self addSubview:_lablePlace];
        
        _lablePrice = [[BaseLabel alloc] init];
        _lablePrice.textColor = [UIColor blackColor];
        _lablePrice.text = price;
        [self addSubview:_lablePrice];
        
        
        
    }
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    [_lableTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top);
        make.left.mas_equalTo(self.mas_left).mas_offset(15);
        make.width.mas_equalTo(self.mas_width).mas_offset(-20);
        make.height.mas_equalTo(self.mas_height).multipliedBy(0.33333);
    }];
    [_lablePlace mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_lableTitle.mas_bottom);
        make.left.mas_equalTo(self.mas_left).mas_offset(15);
        make.width.mas_equalTo(self.mas_width).mas_offset(-20);
        make.height.mas_equalTo(self.mas_height).multipliedBy(0.33333);
    }];

    [_lablePrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_lablePlace.mas_bottom);
        make.left.mas_equalTo(self.mas_left).mas_offset(15);
        make.width.mas_equalTo(self.mas_width).mas_offset(-20);
        make.height.mas_equalTo(self.mas_height).multipliedBy(0.33333);
    }];

}



@end
